<template>
	<view class="big">
		
		<sousuo></sousuo>
		<view class="content-box">
			<view class="view">
				<scroll-view scroll-y="true" class="viewbox">
					
					<view  v-for="(item,index) in right" @click="choice(index)" :class="{Rightcolor: showId == (index)}">
							{{item}}
				
					</view>
				</scroll-view>
			</view>

			<view class="content">
				<view v-show="showId == (index)" class="imgclass" v-for="(item,index) in imgurl">
					<content :imgu='item'></content>
				</view>
				
				<view class="shoplist" @click="toDetails">
					<view v-show="showId == (index)" class="shoptitle" v-for="(item,index) in shoptitle">
						<view class="">
							<text>{{item}}</text>
						</view>
						
					</view>
					<view class="shop">
						<shopitem v-for="(item,index) in shopimg" :shopimg='item'></shopitem>
					</view>
				</view>
				
			</view>
		</view>

	</view>
	<!-- <button @click="test" type="primary">测试</button> -->

</template>

<script>

	export default {

		data() {

			return {
				showId: 0,
				right: ['热门推荐','oppo','一加','平板电脑','智能穿戴','智能耳机','配件','潮流好物','官方定制','官方服务'],
				imgurl: [
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20231208/f8d44e759a387ad1cfcde697093d90312072931526.jpg?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp",
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20231208/94ff69d0c9378612961db0302c0bb8f41527251095.jpg?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp",
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20231207/1bdf1b2b56483020fac63559ec8b37c4-1872489386.jpg?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp",
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20231128/1bdf1b2b56483020fac63559ec8b37c4-1331690436.jpg?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp",
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20230907/f400697463780d5268f4aeadc90abf81236481623.jpg?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp",
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20230425/4ade5696d7a5066f396ca23db89a33c31341175862.webp?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp",
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20230809/1c5353b294979a54f418a880f102fc70917022768.png?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp",
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20231208/1bdf1b2b56483020fac63559ec8b37c41052080936.jpg?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp",
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20231208/1bdf1b2b56483020fac63559ec8b37c41052080936.jpg?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp",
					"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20231208/1bdf1b2b56483020fac63559ec8b37c41052080936.jpg?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp"
				],
				shoptitle:[
					'热门推荐','opps find n 系列','一加ACE系列','oppo平板','oppo智能手表','oppo智能耳机','oppo智能配件','数码周边','手机壳定制','其它'
				],
				shopimg:[
					{
						id:1,
						title:"oppo find N3",
						text:"超轻薄折叠大屏",
						price:9999,
						imgurl:"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20231019/5ace9b5ef00dd3b2f8723576bec74d89-100029441.png?_w_=480&_h_=480&x-oss-process=image%2Fresize%2Cm_mfit%2Climit_1%2Cw_480%2Ch_480%2Fformat%2Cwebp",
					},
					{
						id:2,
						title:"oppo reno10",
						text:"120Hz OLED超清屏",
						price:1899,
						imgurl:"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20230515/129e18c1ad8a057f429386b4e7221d94-447934141.png?_w_=320&_h_=320&x-oss-process=image%2Fformat%2Cwebp"
					},
					{
						id:3,
						title:"OPPO Watch 4 Pro 全智能手表",
						text:"+19.9元抢运动礼盒",
						price:2199,
						imgurl:"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20230822/406fece74aaff40dc665b828437a0627-2127046384.png?_w_=480&_h_=480&x-oss-process=image%2Fresize%2Cm_mfit%2Climit_1%2Cw_480%2Ch_480%2Fformat%2Cwebp"
					},
					{
						id:4,
						title:"OPPO Reno10 Pro+",
						text:"100W超级闪充",
						price:3699,
						imgurl:"https://msecfs.opposhop.cn/commons-media-picture/MEDIA/20230516/30d60d55fefb37dd21adb1422b19d2a22021193044.png?_w_=320&_h_=320&x-oss-process=image%2Fformat%2Cwebp"
					},
					{
						id:5,
						title:"OPPO Pad 2",
						text:"旗舰好屏",
						price:2399,
						imgurl:"https://msecfs.opposhop.cn/commons-media-picture/GOODS/20230515/5ace9b5ef00dd3b2f8723576bec74d89-1551110905.png?_w_=320&_h_=320&x-oss-process=image%2Fformat%2Cwebp"	
					}
				]
			}
		},
		methods: {
			toDetails(){
				uni.navigateTo({
					url:"/pages/shopDetails/shopDetails"
				})
			},
			choice(index) {
				
				this.showId = index
			},

			test() {
				let data = {
					right: [{
						text: "热门推荐",
						imgurl: "https://msecfs.opposhop.cn/commons-media-picture/GOODS/20231208/f8d44e759a387ad1cfcde697093d90312072931526.jpg?_w_=738&_h_=240&x-oss-process=image%2Fformat%2Cwebp"
					}]
				};



			},

		},

		onReachBottom() {
			console.log("触底了！");
			console.log(this.right);


		},
		onLoad() {

		}
	}
</script>

<style>
	page{
		background-color: #f5f5f5;
	}
	.Rightcolor{
		font-size: 40rpx;
		color: black;
		font-weight: 700;
	}
	.viewbox{
		
		left: 0;
		color: #6F9BC6;
		background-color: #f5f5f5;
	}
	.viewbox view {
		
		margin-top: 10rpx;
		width: 186rpx;
		height: 106rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 24rpx;
	

	}

	.big {
		background-color: #f5f5f5;
		display: flex;
		flex-direction: column;
		
	}
	.content-box{
		display: flex;
	}
	.content {
		background-color: #f5f5f5;
		display: flex;
		flex-direction: column;
		
	}
	.shoptitle{
		width: 560rpx;
		height: 80rpx;
		display: flex;
		align-items: center;
		font-size: 30rpx;
		
	}
	.imgclass{
		width: 586rpx;
		height: 182rpx;
	}




</style>